//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package org.quickserver.net.server.impl;

import java.nio.channels.ClosedChannelException;
import java.nio.channels.SelectableChannel;
import java.nio.channels.Selector;
import java.util.logging.Logger;

public class RegisterChannelRequest {
    private static final Logger logger = Logger.getLogger(RegisterChannelRequest.class.getName());
    private SelectableChannel channel;
    private int ops;
    private Object att;

    public RegisterChannelRequest(SelectableChannel channel, int ops, Object att) {
        this.channel = channel;
        this.ops = ops;
        this.att = att;
    }

    public void register(Selector selector) {
        try {
            this.channel.register(selector, this.ops, this.att);
        } catch (ClosedChannelException var3) {
            logger.warning("Error: " + var3);
        }

    }

    public SelectableChannel getChannel() {
        return this.channel;
    }

    public void setChannel(SelectableChannel channel) {
        this.channel = channel;
    }

    public int getOps() {
        return this.ops;
    }

    public void setOps(int ops) {
        this.ops = ops;
    }

    public Object getAtt() {
        return this.att;
    }

    public void setAtt(Object att) {
        this.att = att;
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } else {
            RegisterChannelRequest req = (RegisterChannelRequest)obj;
            boolean res = req.getChannel() == this.getChannel();
            if (res) {
                res = req.getAtt() == this.getAtt();
            }

            if (res) {
                res = req.getOps() == this.getOps();
            }

            return res;
        }
    }
}
